//
//  WeiFaHuoListCell.m
//  FactorySale
//
//  Created by 李 on 2020/1/7.
//  Copyright © 2020 主事丫环. All rights reserved.
//

#import "WeiFaHuoListCell.h"

@implementation WeiFaHuoListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.layer.cornerRadius = 8;
    self.clipsToBounds = YES;
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(phoneClick:)];
    [self.phoneLab addGestureRecognizer:tap];
    self.phoneLab.userInteractionEnabled = YES;
}
-(void)phoneClick:(UITapGestureRecognizer *)tap
{
    if (_model.phone) {
        [HFTools callMobilePhone:_model.phone];
    }
     
}
- (void)setFrame:(CGRect)frame{
         frame.origin.x += 15;
         frame.size.width -= 30;
         [super setFrame:frame];

}
-(void)setModel:(WeiFaHuoOrderListModel *)model
{
    _model = model;
    if (_model) {
         self.timeLab.text = [NSString stringWithFormat:@"%@",_model.createTime];
        self.phoneLab.text = [NSString stringWithFormat:@"%@",_model.phone];
        self.companyNameLab.text = [NSString stringWithFormat:@"%@",_model.name];
        self.diZhiLab.text = [NSString stringWithFormat:@"%@",_model.address];
        self.timeLab.text = [NSString stringWithFormat:@"%@",_model.createTime];
        //    是否接单 0否1是
        if ([_model.isSubFactory isEqualToString:@"1"]) {
            [self.typeBtn setImage:[UIImage imageNamed:@"已接单"] forState:UIControlStateNormal];
        }
        if ([_model.isSubFactory isEqualToString:@"0"]) {
            [self.typeBtn setImage:[UIImage imageNamed:@"未接单"] forState:UIControlStateNormal];

        }
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
